import fetch from '@/utils/fetch'

const deviceApi = {
  getPageList (params) {
    return fetch({
      url: '/api/device/deviceList',
      method: 'get',
      params: params
    })
  },
  add (data) {
    return fetch({
      url: '/api/device/add',
      method: 'post',
      data: data
    })
  },
  update (data) {
    return fetch({
      url: '/api/device/update',
      method: 'put',
      data: data
    })
  },
  del (id) {
    return fetch({
      url: '/api/device/delete/' + id,
      method: 'delete'
    })
  },
  getDetail (id) {
    return fetch({
      url: '/api/device/capturePic/' + id,
      method: 'get'
    })
  },
  getDevice (data) {
    return fetch({
      url: '/api/device/getDevice',
      method: 'get',
      params: data
    })
  }
}
export default deviceApi
